//
//  AIChatManager.h
//  Mia
//
//  Created by Vill on 2024/1/20.
//

#import <Foundation/Foundation.h>
#import "AIChatModel.h"

NS_ASSUME_NONNULL_BEGIN

@protocol AIChatManagerDelegate <NSObject>

@required

//接收消息代理
- (void)didReceiveMessage:(AIResponse *)response withChatModel:(nullable AIChatResponseContentModel *)chatModel;

// 接收消息报错
- (void)didReceiveMessageWithErrorData:(AIResponse *)response;

@optional

//发送消息超时代理
- (void)sendMessageTimeOutWithTag:(long)tag;

@end

@interface AIChatManager : NSObject

//socket连接状态
@property (nonatomic, assign) SocketConnectStatus connectStatus;

//聊天单例
+ (instancetype)shareInstance;
//连接服务器端口
- (void)connectServerHost;
//主动断开连接
- (void)executeDisconnectServer;
//添加代理
- (void)addDelegate:(id<AIChatManagerDelegate>)delegate delegateQueue:(nullable dispatch_queue_t)queue;
//移除代理
- (void)removeDelegate:(id<AIChatManagerDelegate>)delegate;
//发送消息
- (void)sendMessage:(AIChatModel *)chatModel timeOut:(NSUInteger)timeOut tag:(long)tag;

- (void)sendMessageWithDic:(NSDictionary *)dic timeOut:(NSUInteger)timeOut tag:(long)tag;

@end

NS_ASSUME_NONNULL_END
